# coding: utf-8
module Login
  def web_login(user)
=begin
    username = user['login_username']
    password = user['login_password']

    @driver.get(@base_url)
    @driver.find_element(:link, "登 录").click
    @driver.find_element(:id, "u").clear
    @driver.find_element(:id, "u").send_keys username
    @driver.find_element(:id, "p").clear
    @driver.find_element(:id, "p").send_keys password
    @driver.find_element(:id, "aLogin").click
    @driver.switch_to.default_content()
=end
    username = user['login_username']
    @driver.get(@base_url+"?force_login=#{username}")

    $login_user = user.clone
    end

	def login_out
		if element_present?(:id, "drop1") then
      @driver.get(@base_url + 'single_sign_on/logout')
      $login_user.clear
    end
	end
end